package com.netcracker.training.automonic.dao.roles.oracle;

import java.sql.Date;
import java.util.List;

import org.apache.log4j.Logger;

import com.netcracker.training.automonic.dao.entities.Attribute;
import com.netcracker.training.automonic.dao.entities.AttributeType;
import com.netcracker.training.automonic.dao.entities.Object;
import com.netcracker.training.automonic.dao.entities.Site;
import com.netcracker.training.automonic.dao.entities.Statistics;
import com.netcracker.training.automonic.dao.entities.StatsType;
import com.netcracker.training.automonic.dao.factories.oracle.OracleDAOFactory;
import com.netcracker.training.automonic.dao.roles.ReadDAO;
import com.netcracker.training.automonic.dao.roles.ReadWriteDAO;
import com.netcracker.training.automonic.dao.roles.WriteDAO;

/**
 * Concrete DAO role for Oracle Database Express Edition 11g Release 2.
 * 
 * @author Vadim Gidulyan
 * 
 * @see ReadWriteDAO
 * @see OracleDAOFactory
 */

public class OracleReadWriteDAO implements ReadWriteDAO // TODO Javadoc
{

	public static final Logger LOGGER = Logger.getLogger(OracleReadWriteDAO.class);
	
	private final ReadDAO rd;
	private final WriteDAO wd;
	
	/**
	 * Constructs DAO for Oracle DB with concrete role.
	 */
	public OracleReadWriteDAO(ReadDAO rd, WriteDAO wd)
	{
		this.rd  = rd;
		this.wd  = wd;
	}
	
	@Override
	public Site selectSiteById(int id)
	{
		return rd.selectSiteById(id);
	}

	@Override
	public Site selectSiteByName(String name)
	{
		return rd.selectSiteByName(name);
	}

	@Override
	public Object selectObjectById(int id)
	{
		return rd.selectObjectById(id);
	}

	@Override
	public Object selectObjectBySiteAndName(Site site, String name)
	{
		return rd.selectObjectBySiteAndName(site, name);
	}

	@Override
	public List<Object> selectObjectsBySite(Site site)
	{
		return rd.selectObjectsBySite(site);
	}

	@Override
	public List<Object> selectObjectsByName(String name)
	{
		return rd.selectObjectsByName(name);
	}

	@Override
	public AttributeType selectAttributeTypeById(int id)
	{
		return rd.selectAttributeTypeById(id);
	}

	@Override
	public AttributeType selectAttributeTypeByCode(String code)
	{
		return rd.selectAttributeTypeByCode(code);
	}

	@Override
	public List<AttributeType> selectAttributeTypesByName(String name)
	{
		return rd.selectAttributeTypesByName(name);
	}

	@Override
	public Attribute selectAttributeById(int id)
	{
		return rd.selectAttributeById(id);
	}

	@Override
	public Attribute selectAttributesByObjectAndType(Object object, 
			AttributeType attributeType)
	{
		return rd.selectAttributesByObjectAndType(object, attributeType);
	}

	@Override
	public List<Attribute> selectAttributesByObject(Object object)
	{
		return rd.selectAttributesByObject(object);
	}

	@Override
	public List<Attribute> selectAttributesByType(AttributeType attributeType)
	{
		return rd.selectAttributesByType(attributeType);
	}

	@Override
	public StatsType selectStatsTypeById(int id)
	{
		return rd.selectStatsTypeById(id);
	}

	@Override
	public StatsType selectStatsTypeByCode(String code)
	{
		return rd.selectStatsTypeByCode(code);
	}

	@Override
	public List<StatsType> selectStatsTypesByName(String name)
	{
		return rd.selectStatsTypesByName(name);
	}

	@Override
	public Statistics selectStatistics(Date time, Object object,
			StatsType statsType)
	{
		return rd.selectStatistics(time, object, statsType);
	}

	@Override
	public List<Statistics> selectStatisticsByTime(Date time)
	{
		return rd.selectStatisticsByTime(time);
	}

	@Override
	public List<Statistics> selectStatisticsByObject(Object object)
	{
		return rd.selectStatisticsByObject(object);
	}

	@Override
	public List<Statistics> selectStatisticsByType(StatsType statsType)
	{
		return rd.selectStatisticsByType(statsType);
	}

	@Override
	public List<Site> selectAllSites()
	{
		return rd.selectAllSites();
	}

	@Override
	public List<Object> selectAllObjects()
	{
		return rd.selectAllObjects();
	}

	@Override
	public List<AttributeType> selectAllAttributeTypes()
	{
		return rd.selectAllAttributeTypes();
	}

	@Override
	public List<Attribute> selectAllAttributes()
	{
		return rd.selectAllAttributes();
	}

	@Override
	public List<StatsType> selectAllStatsTypes()
	{
		return rd.selectAllStatsTypes();
	}

	@Override
	public List<Statistics> selectAllStatistics()
	{
		return rd.selectAllStatistics();
	}

	@Override
	public Site createSite(String name)
	{
		return wd.createSite(name);
	}

	@Override
	public Object createObject(Site site, String name)
	{
		return wd.createObject(site, name);
	}

	@Override
	public AttributeType createAttributeType(String code, String name)
	{
		return wd.createAttributeType(code, name);
	}

	@Override
	public Attribute createAttribute(Object object, AttributeType attributeType)
	{
		return wd.createAttribute(object, attributeType);
	}

	@Override
	public StatsType createStatsType(String code, String name)
	{
		return wd.createStatsType(code, name);
	}

	@Override
	public Statistics createStatistics(Object object, StatsType statsType)
	{
		return wd.createStatistics(object, statsType);
	}

}
